<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'foodManager.jsp' starting page</title>
     <link href="${pageContext.request.contextPath }/css/waimaistyle.css"
	type=text/css rel=stylesheet />
    <style type="text/css">
    	.food_list{
    		text-align: center;
    	}
    </style>
  </head>
  
  <body>
    <p align="center">食品信息查看</p>
    <div class="food_list">
	    <table  align="center" border="1" cellspacing="0" cellpadding="20"
			class="table">
			<tr>
				<td>食品编号</td>
				<td>食品名称</td>
				<td>食品单价</td>
				<td>上线时间</td>
				<td>月销售量</td>
				<td>是否上架</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${foodList }" var="f"> 
				<tr>
					<td>${f.foodId }</td>
					<td>${f.foodName }</td>
					<td>${f.price }</td>
					<td>
						<fmt:formatDate value="${f.pubTime }" pattern="yyyy-MM-dd"/>
						</td>
					<td>${f.monthSales }</td>
					<td>
						<c:choose>
							<c:when test="${f.enabled=true }">上架</c:when>
							<c:otherwise>未上架</c:otherwise>
						</c:choose>
					<td>
						<a href="${pageContext.request.contextPath }/admin/toUpdateFood?foodId=${f.foodId}">更新</a>
					</td>
				</tr>
			</c:forEach>
		</table>
    </div>
  </body>
</html>
